/**
 * Copyright (c) Software Institute of PKU
 * All rights reserved. 
 * This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 */
package edu.pku.sei.transformation.editor.views.figures;

import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.draw2d.geometry.Rectangle;

import edu.pku.sei.transformation.editor.views.colors.ColorProvider;
import edu.pku.sei.transformation.editor.views.icons.IconsProvider;

/**
 * @generated
 * 
 */
public class GraphicalDomainFigure extends DomainFigure {
	private Figure body = new Figure();

	public GraphicalDomainFigure() {
		super();
		this.nameLabel.setIcon(IconsProvider
				.getImage(IconsProvider.AREA_DIAGRAM_ICO));
		this.add(body);
		body.setBounds(this.getBounds());
		body.setLayoutManager(new XYLayout());
	}

	public void hide() {
		this.setOpaque(false);
		// this.setBackgroundColor(ColorConstance.WHITE);
		this.remove(nameLabel);
		// nameLabel.setForegroundColor(ColorConstance.WHITE);
		this.border.setColor(ColorProvider.getColor(230, 230, 230));
	}

	public void show() {
		this.setOpaque(true);
		// this.setBackgroundColor(color);
		// nameLabel.setForegroundColor(color);
		this.add(nameLabel);
		this.border.setColor(color);
	}

	@Override
	public void setBounds(Rectangle rect) {
		super.setBounds(rect);
		this.body.setBounds(rect);
	}

	public Figure getBody() {
		return body;
	}

}
